


import { DataTypes } from 'sequelize';
import sequelize from '../config/db.js';

const ArticleStat = sequelize.define('ArticleStat', {
  article_id: {
    type: DataTypes.INTEGER.UNSIGNED,
    allowNull: false,

  },
  view_count: {
    type: DataTypes.INTEGER.UNSIGNED,
    defaultValue: 0
  },
  last_viewed_at: {
    type: DataTypes.DATE,
  }
}, {
  timestamps: true,
  updatedAt: 'updated_at',
  createdAt: 'created_at'
});

export default ArticleStat;